<% layout('layout/layout') %>
<% block('header').append(`<style>
</style>`)%>
<div class="row">
  <div class="col-xs-12">
    <div class="box">
      <div class="box-header">
        <h3 class="box-title">用户管理</h3>
        <div class="box-tools">
          <a class="btn  btn-sm btn-success" href="add">添加+</a>
          <!--<div class="input-group input-group-sm" style="width: 150px;">-->
          <!--<input type="text" name="table_search" class="form-control pull-right" placeholder="Search">-->

          <!--<div class="input-group-btn">-->
          <!--<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>-->
          <!--</div>-->
          <!--</div>-->
        </div>
      </div>
      <!-- /.box-header -->
      <div class="box-body table-responsive no-padding">
        <table class="table table-bordered table-hover">
          <tbody>
          <tr>
            <th>头像</th>
            <th>用户名称</th>
            <th>昵称</th>
            <th>用户手机号</th>
            <th>状态</th>
            <th>创建时间</th>
            <th>操作</th>
          </tr>
          <% users.forEach(function(item){%>
          <tr>
            <td>
              <%if (item.headImg){%>
              <img src="<%=item.headImg %>" style="width:48px;" >
              <% } %>
            </td>
            <td><%=item.userName || ''%></td>
            <td><%=item.nickname  || '' %></td>
            <td><%=item.mobile   || '' %></td>
            <td><%=item.isLock===0 ?'有效':'无效'%></td>
            <td><%=item.create_at_ago()%></td>
            <td>
              <a class="btn  btn-sm btn-success" href="add?update=<%=item._id %>">修改</a>
            </td>
          </tr>
          <% }) %>
          </tbody>
        </table>
      </div>
      <!-- /.box-body -->
    </div>
    <!-- /.box -->
    <div class="j_pager" data-page="<%=page %>"  data-count="<%=count%>"></div>
  </div>

</div>
<% block('footer').append(`<script src="${assetsPath}/js/uploadImg.js"></script>`); %>
<% block('footer').append(`<script src="${assetsPath}/js/pager.js" ></script>`); %>
<% block('footer').append(`<script>
$('.j_pager').pager();
</script>`)%>